From: Matthias Clasen Date: Sat, 8 Jun 2013 17:32:35 +0000 (-0400) Subject: main: Show a warning when running as root X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~781^2^2~554 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=a65164e54089a779dd461e348032f552b4d4d521;p=gnome-shell.git main: Show a warning when running as root gnome-session used to show a dialog in this case, but a notification is more natural nowadays. Doing it in gnome-shell avoids complicated synchronization between gnome-session and gnome-shell. https://bugzilla.gnome.org/show_bug.cgi?id=701212 --- diff --git a/js/ui/main.js b/js/ui/main.js index 17f5bc716..d8b0b9b6a 100644 --- a/js/ui/main.js +++ b/js/ui/main.js @@ -262,6 +262,12 @@ function _initializeUI() { }); } + let credentials = new Gio.Credentials(); + if (credentials.get_unix_user() === 0) { + notify(_('Logged in as a privileged user'), + _('Running a session as a privileged user should be avoided for security reasons. If possible, you should log in as a normal user.')); + } + LoginManager.registerSessionWithGDM(); let perfModuleName = GLib.getenv("SHELL_PERF_MODULE");